<!--
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="/mytaglib" prefix="cc"%>  
  -->
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="your keywords">
    <meta name="description" content="your description">
    <meta name="author" content="author,email address">
    <meta name="format-detection" content="telephone=no"/>
    <title>菜品录入</title>
    <cc:css src="h"/>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<div id="wrapper">
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close"><i class="fa fa-times-circle"></i>
        </div>
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu">
                <li>
                    <a href="${base}/web/deedList" ><span class="nav-label">主页</span></a>
                </li>
                <li>
                    <a href="javascript:void(0);" data-id="${deedId}" class="export"><span class="nav-label">导出采购报表</span></a>
                </li>
                <c:forEach var="merchant" items="${merchantList}">
                <li>
                    <a href="javascript:void(0);" class="merchant_item"  data-id="${merchant.id}"><span class="nav-label">${merchant.name}</span></a>
                    <ul class="nav nav-second-level">
                        <c:forEach var="subMerchant" items="${merchant.subMerchants}">
                        <li><a class="J_menuItem merchant_item"  data-id="${subMerchant.id}"
                               href="javascript:void(0);">${subMerchant.name}</a>
                        </li>
                        </c:forEach>
                    </ul>
                </li>
                </c:forEach>
            </ul>
        </div>
    </nav>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <c:if test="${merchant.hasChild}">
    <div class="gray-bg dashbard-1" style="padding:10px 10px;height:auto">
        <div style="height: 38em;">
            <h1 style="text-align: center">${merchant.name}  节点不可录入！</h1>
        </div>

    </div>
    </c:if>
    <c:if test="${!merchant.hasChild}">
    <div id="page-wrapper" class="gray-bg dashbard-1" style="padding:10px 10px;height:auto">
            <h2 style="text-align: center">${merchant.name} 录入</h2>

            <div class="row">
                <div class="col-lg-4">
                    <div class="input-group" style="width: 100%">
                        <input type="text"  placeholder="输入菜品或菜品拼音" class="form-control" id="goodInput">
                        <div class="input-group-btn">
                            <ul class="dropdown-menu dropdown-menu-right" role="menu">
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3">
                    <input type="number" id="number" placeholder="输入数字,enter直接添加" class="form-control">
                </div>
                <div class="col-lg-2">
                    <a class="btn btn-primary" data-toggle="modal" id="add">添加(或直接enter)</a>
                </div>
                <div class="col-lg-1">
                </div>
            </div>
            <div class="row" style="margin: 1em 1em;">
            </div>
            <!--table -->
            <div class="row" id="purchase_box">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h3>已录入菜品</h3>
                        </div>
                        <div class="ibox-content">

                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>菜品</th>
                                    <th>数量</th>
                                    <th style="width: 30em">备注</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <!-- ko foreach:list -->
                                <!--  ko workItem: _goodEntry.workItem--> <!--/ko  -->
                                <tr class="item" data-bind="attr:{'data-index':$index}">
                                    <td data-bind="text:goodName"></td>
                                    <td data-bind="visible:!isEdit(),text:number"></td>
                                    <td data-bind="visible:isEdit()" style="display: none">
                                        <input type="number" class="form-control" data-bind="value:number">
                                    </td>
                                    <td data-bind="visible:!isEdit(),text:remark"></td>
                                    <td data-bind="visible:isEdit()" style="display: none">
                                        <input type="remark" class="form-control" data-bind="value:remark">
                                    </td>
                                    <td>
                                        <img class="change" data-bind="visible:!isEdit()" height="30px" width="40px"
                                             src="${base}/web/res/image/change.png">
                                        <img class="save" style="display: none" data-bind="visible:isEdit()"
                                             height="30px" width="40px" src="${base}/web/res/image/save.png">
                                        <img class="delete" height="30px" width="40px"
                                             src="${base}/web/res/image/delete.png">
                                    </td>
                                </tr>
                                <!-- /ko -->
                                </tbody>
                            </table>

                        </div>
                    </div>
                </div>

        </div>
    </div>
    </c:if>
</div>


</body>
<cc:js src="common,suggest,localforage,ko,web/main/good_entry.js"/>
<script type="text/data" id="data-goodList">
   ${cc:toJson(goodList)}
</script>
<script type="text/data" id="data-deedId">
   ${cc:toJson(deedId)}
</script>
<script type="text/data" id="data-merchantId">
   ${cc:toJson(merchantId)}
</script>
<script type="text/data" id="data-merchant">
   ${cc:toJson(merchant)}
</script>
<script type="text/data" id="data-parentMerchant">
   ${cc:toJson(parentMerchant)}
</script>
<script type="text/data" id="data-purchaseList">
   ${cc:toJson(purchaseList)}
</script>
</html>